package com.zb.test;

import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zb.Service.MoneyService;
import com.zb.Service.UserService;
import com.zb.entity.Department;
import com.zb.entity.Money;
import com.zb.entity.Role;
import com.zb.entity.User;

public class Tset4 {
	public static void main(String[] args) {
		ApplicationContext ac = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
//		MoneyService ms = (MoneyService)ac.getBean("MoneyService");
	UserService us = (UserService)ac.getBean("UserService");	
//		Money m  = new Money();
//		m.setId(1);
//		User u = new User();
//		u.setId(4);
//		m.setUser(u);
//		//m.setOrdertime("2017/4/27 星期四 9:53:59");
//		Department d = new Department();
//		d.setId(2);
//		m.setDepartment(d);
//		m.setContent("买房");
//		m.setState(0);
//		Role r = new Role();
//		r.setId(1);
//		m.setRole(r);
//		ms.updateMoney(m);
//		ms.saveMoney(m);
//		ms.delectMoney(5);
//		List<Money> list = ms.findMoney();
//		for (Money money : list) {
//			System.out.println(money.getContent());
//		}
//		Money money = ms.getMoneyById(1);
//		System.out.println(money.getContent());
		User u = new User();
		u.setId(2);
		u.setPassword("123");
		us.updateUserPwd(u);
		
	}
}
